package org.dftproject.genesis.core.data.flow;

import org.dftproject.genesis.data.genealogy.IPerson;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExecutableExtension;

public abstract class DataProvider implements IExecutableExtension {

	public static final int INACTIVE = 0;
	public static final int ACTIVE = 1;
	public static final int PASSIVE = 2;

	private String name;

	public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
		name = config.getAttribute("name");
	}

	public String getName() {
		return name;
	}

	/**
	 * Collects objects related to the given URI.
	 * @param uri a URI
	 * @param collector an object collector
	 */
	public abstract void getRelatedObjects(String uri, Collector<Object> collector);
	
	/**
	 * Collects objects related to the given URI.
	 * @param person a person
	 * @param collector an object collector
	 */
	public abstract void getRelatedObjects(IPerson person, Collector<Object> collector);

}
